import http from 'k6/http';
import {sleep} from 'k6';

const BASE_URL = "http://192.168.96.20:1234"

export default function(){
    let url = `${BASE_URL}/manager_app/company_group/realtime`;
    const payload = JSON.stringify({
      "sort_by_pure_revenue": false
   });
    const params = {headers: {
        'Content-Type' : 'application/json',
        'x-auth-token' : '888888888888888888888888888888',
        'x-auth-secid' : '4CC787E2F7F1B3428ACAFB407D0A3CE6'
    }};
    http.post(url, payload, params);
    sleep(0.3)
}

export let options = {
    duration: '60s',
    thresholds: {
        "http_req_duration" : ["p(99) < 500"]
    }
};

